Repository navigation
fix: nullable expiryDate, optional customer email, and doc corrections - #9
Merged
Merged
Conversation
- UpdateKeyParams.expiryDate accepts null (or "") to remove the expiry; the request body keeps the null. Omitting it keeps the current expiry. - CreateCustomerParams.email is optional, matching POST /customer. - getOrCreateInstallationId JSDoc: a failed write is swallowed and an unsaved ID is returned instead of throwing. Behaviour is unchanged. - README: methods reject with KeyMintApiError; floating endpoints ignore Idempotency-Key, so replays never return floating-session secrets. - Tests: updateKey null/omitted expiryDate, createCustomer without email, and a type-level check run by npm test.
…pdateKey A whole number 0-1,000,000 (number or digit string) or "unlimited"; null means unlimited and is sent as-is. Adds type-level checks and contract tests for the null case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UpdateKeyParams.expiryDateis nowstring | null.null(or"") removes the key's expiry; omitting the field keeps it. The request body sendsnullas-is (axios does not drop it).CreateKeyParams.maxActivationsandUpdateKeyParams.maxActivationsarenumber | string | null: a whole number 0–1,000,000 (number or digit string) or"unlimited";nullmeans unlimited and is sent as-is.CreateCustomerParams.emailis optional, matchingPOST /customer(onlynameis required).getOrCreateInstallationIdJSDoc no longer claims it throws when the file can't be written. It now says the write error is swallowed and an unsaved ID is returned. No behaviour change.KeyMintApiError(the Error Handling section already shows branching onerrorCode). The Idempotency section no longer says replays return floating-session secrets: the floating endpoints ignoreIdempotency-Key. The floating methods' JSDoc says the same.Tests
updateKeysends"expiryDate":null,updateKeyomitsexpiryDatewhen unset,createCustomerworks withoutemail,createKey/updateKeysend"maxActivations":null.tests/types/params.check.ts, run bynpm testvianpm run typecheck:tests. It fails against the old types.npm run lintandnpm testpass (57 tests). Live tests not run.